package com.itgungnir.designpattern.factory.simplefactory;

import com.itgungnir.designpattern.factory.car.BMW;
import com.itgungnir.designpattern.factory.car.BMW320;
import com.itgungnir.designpattern.factory.car.BMW523;

/**
 * 汽车工厂类，类中封装了生产车型的判断逻辑
 */
public class FactoryBMW {
	public static final int TYPE_BMW523 = 1;
	public static final int TYPE_BMW320 = 2;

	public static BMW createBMW(int type) {
		switch (type) {
		case TYPE_BMW523:
			return new BMW523();
		case TYPE_BMW320:
			return new BMW320();
		}
		return null;
	}
}